home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-06-28 | 845 b | 47 lines | [TEXT/CWIE] |
- // Progress.h
-
- #ifndef Progress_h
- #define Progress_h
-
- #ifndef Announcer_h
- #include "Announcer.h"
- #endif
- #ifndef Integers_h
- #include "Integers.h"
- #endif
-
- class Progress: public Announcer
- {
- private:
- uint32 portion;
- uint32 total;
- bool totalKnown;
-
- public:
- Progress();
- Progress( uint32 total );
-
- bool TotalKnown() const { return totalKnown; }
- uint32 Portion() const { return portion; }
- uint32 Total() const { Assert( totalKnown ); return total; }
-
- double Fraction() const;
-
- bool Finished() const { return portion >= total; }
- bool Unfinished() const { return portion < total; }
-
- void Clear();
- void Clear( uint32 );
-
- void SetTotal( uint32 );
-
- void SetPortion( uint32 );
-
- void Set( uint32 portion, uint32 total );
-
- void operator++();
- void operator++(int) { operator++(); }
- };
-
- #endif
-